import { Form } from 'antd';
import type { FormInstance } from 'antd';
import type React from 'react';
import { useEffect } from 'react';
import CardInfoForm from '../CardInfoForm';

interface EditCardInfoFormProps {
  card: any;
  form: FormInstance;
}

const EditCardInfoForm: React.FC<EditCardInfoFormProps> = ({ card, form }) => {
  useEffect(() => {
    form.setFieldsValue(card);
  }, [card, form]);

  return (
    <Form form={form} layout="vertical">
      <CardInfoForm isEditMode />
    </Form>
  );
};

export default EditCardInfoForm;
